#include "MainWindow.h"

#include "Backend/QTofelClient.h"

#include <QMessageBox>

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
    m_cli = new QTofelClient(this);
    if (!m_cli->start()) {
        QMessageBox::critical(this, tr("Error"), tr("QTofel backend failed to start."));
        ::exit(-1);
    }

    m_button = new QPushButton("input 1");
    connect(m_button, &QPushButton::clicked, this, &MainWindow::handleButtonClicked);

    setCentralWidget(m_button);
}

MainWindow::~MainWindow() {
}

void MainWindow::handleButtonClicked() {
    m_cli->inputOne();
}
